﻿using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Configuration;
using DropBoxClient.Entities;

namespace DropBoxClient.Tests
{
    [TestClass]
    public class DeleteFolderTest
    {
        private string accessToken;
        private Meta meta;

        [TestInitialize]
        public void Init()
        {
            accessToken = ConfigurationManager.AppSettings["AccessToken"];
            var client = new OAuth2Client(accessToken);
            client.CreateFolder(StringConstants.SandboxRoot, "MyFolder");
            meta = client.Delete(StringConstants.SandboxRoot, "MyFolder");
        }

        [TestMethod]
        public void Delete_ResultIsNotNull()
        {          
            Assert.IsNotNull(meta);
        }

        [TestMethod]
        public void Delete_DeletedFolderPathIsValid()
        {
            Assert.AreEqual("/MyFolder", meta.Path);
        }
    }
}
